<template>
  <div class="cl">
    <el-dialog
    title="提示"
    :visible.sync="dialogVisible"
    width="350px">
    <span style="font-size:20px">超过系统最大文件容量,无法上传!</span>
    <span slot="footer" class="dialog-footer">
      <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
      <el-button type="primary" style="background:#E60012 !important;border:none !important" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
    <header-nav :index_num="index_num"></header-nav>
    <div id="excute_box">
      <!--内容-->
      <div class="excute_con">
        <h3>一、项目申报书</h3>
        <p>
          <a :href="getsubs.probook" target="_blank">{{shili? shili.split('_')[0]+''+(shili.split('_')[0].includes('.')?'':'.'+shili.split('.')[1]):"未上传"}}</a>
          <a :href="getsubs.probook" target="_blank">{{getsubs.probook.split('/')[8] == 'pdf'||getsubs.probook.split('/')[8] == 'jpeg'||getsubs.probook.split('/')[8] == 'png'||getsubs.probook.split('/')[8] == 'jpg'?'预览':'下载'}}</a>
        </p>
        <h3>二、项目实施方案</h3>
        <p>
          <a :href="getsubs.fangan" target="_blank">{{shili1? shili1.split('_')[0]+''+(shili1.split('_')[0].includes('.')?'':'.'+shili1.split('.')[1]):"未上传"}}</a>
          <a :href="getsubs.fangan" target="_blank">{{getsubs.fangan.split('/')[8] == 'pdf'||getsubs.fangan.split('/')[8] == 'jpeg'||getsubs.fangan.split('/')[8] == 'png'||getsubs.fangan.split('/')[8] == 'jpg'?'预览':'下载'}}</a>
        </p>
        <h3>三、中期报告</h3>
        <h3>
          <span style="color:red;margin-right:10px">*</span>1、基本信息
        </h3>
        <aside>
          <div style="margin-left:15px">
               <div class="writeinfo">
            <label>项目名称:</label>
            <el-input
              v-model="getsubs.name"
              name="company"
              style="width:350px"
              required
              class="shuru"
            ></el-input>
            <!-- <input type="text" name="company" v-model="getsubs.name" value disabled required /> -->
          </div>
          <div class="writeinfo">
            <label>机构名称:</label>
            <el-input
              v-model="getsubs.company"
              name="name"
              style="width:350px"
              required
              class="shuru"
            ></el-input>
            <!-- <input
              type="text"
              name="name"
              value
              v-model="getsubs.company"
              disabled
              required
              class="division"
            />-->
          </div>
          <div class="writeinfo">
            <label>申请日期:</label>
            <!-- <input type="date" name="aterm" v-model="starttime"  required />
            <el-date-picker v-model="starttime"></el-date-picker>
            <span>至</span>
            <input type="date" name="fterm" v-model="endtime" value required />
            <el-date-picker v-mode="endtime"></el-date-picker>-->
            <el-date-picker
              v-model="visitDate"
              type="daterange"
              @change="getTime"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              class="shuru"
            ></el-date-picker>
          </div>
          </div>

          <!-- <div>
            <h3>
              <span style="color:red;margin-right:10px">*</span>项目执行团队人员构成及分工:
            </h3>
            <div class="rich">
                    <DivisionLabor
                    @divisionLabor="teamchange"
                    :divisionLaborVal="team"
                    :writeable="true"
                  ></DivisionLabor>
            </div>
          </div> -->
        </aside>

        <!-- <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>2.项目发展性状况
          </h3>
          <div class="rich">
                 <DivisionLabor
                    @divisionLabor="fazhan"
                    :divisionLaborVal="infomrText"
                    :writeable="true"
                  ></DivisionLabor>
          </div>
        </div>
        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>3、项目实施情况
          </h3>
          <div class="rich">
                <DivisionLabor
                    @divisionLabor="goals"
                    :divisionLaborVal="goalsText"
                    :writeable="true"
                  ></DivisionLabor>

          </div>
        </div>
        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>4、项目取得的成效
          </h3>
          <div class="rich">
              <DivisionLabor
                    @divisionLabor="effect"
                    :divisionLaborVal="effectText"
                    :writeable="true"
                  ></DivisionLabor>

          </div>
        </div>

        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>5、项目实施至今的情况总结
          </h3>
          <div class="rich">
               <DivisionLabor
                    @divisionLabor="plement"
                    :divisionLaborVal="plementText"
                    :writeable="true"
                  ></DivisionLabor>
          </div>
        </div> -->
        <!-- <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>6、项目财务报告（按实际支出列出明细，上传文件）
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile2"
            :disabled="subdata.status == 1000"
          >
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <el-progress
                v-if="uploadname[0] && uploadname[0] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[0]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl" :src="imageUrl" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        <a class="filename" :href="fileurl">{{filename?filename:''}}</a>
          <p class="tip">点击上方图标可上传文件</p>

          <div @click="beforeRemove1(filename,'imageUrl')" v-if="imageUrl&&subdata.status!=1000">
            <i class="el-icon-close close"></i>
          </div>
        </div> -->
        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>2、中期报告上传
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile1"
            :disabled="subdata.status == 1000"
            accept=".pdf"
          >
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <!-- {{uploadname[2]}} -->
              <!--   -->
              <el-progress
                v-if="uploadname[1] && uploadname[1] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[1]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl1" :src="imageUrl1" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- {{filename1? filename1.split('_')[0]+''+(filename1.split('_')[0].includes('.')?'':'.'+filename1.split('.')[1]):""}} -->
          <a class="filename" :href="fileurl1">{{filename1?filename1:''}}</a>
          <p class="tip">点击上方图标可上传文件</p>
          <!--文件上传-->
          <div @click="beforeRemove1(filename1,'imageUrl1')" v-if="imageUrl1&&subdata.status!=1000">
            <i class="el-icon-close close"></i>
          </div>
        </div>
        <div class="mid_box">
          <h3>
            <!-- <span style="color:white;margin-right:10px">*</span>-->四、项目调整申请表及批复意见表（若无项目调整，此项材料就不需要提交）
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile"
            :disabled="subdata.status == 1000"
          >
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <!-- {{uploadname[2]}} -->
              <!--   -->
              <el-progress
                v-if="uploadname[2] && uploadname[2] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[2]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl2" :src="imageUrl2" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- {{filename2? filename2.split('_')[0]+''+(filename2.split('_')[0].includes('.')?'':'.'+filename2.split('.')[1]):""}} -->
          <a class="filename" style="margin-top:10px" :href="fileurl2">{{filename2?filename2:''}}</a>
          <p class="tip">点击上方图标可上传文件</p>
          <div @click="beforeRemove1(filename2,'imageUrl2')" v-if="imageUrl2&&subdata.status!=1000">
            <i class="el-icon-close close" ></i>
          </div>
          <!--文件上传-->
        </div>
        <div class="mid_box">
          <!--   style="height: 40px;
                margin-top: 61px;
                top: 49px;
                position: relative;
                right: 168px;" -->

          <div style="display:flex">
            <h3 style="text-align:justify">
              <span style="color:red">*</span>
              五、活动类/培训类/会议类材料：【以下内容基于但不限于】签到表、活动方案或内容、活动反馈(反馈记录或反馈表)、活动照
              <span
                style="color:white"
              >**</span>片或视频培训课件、媒体报导等(原则上体现两点：活动实际发生&活动效果)
            </h3>
              <el-button
              type="primary"
              plain
            style="height: 40px;
                margin-top: 61px;
                top: 49px;
                position: relative;
                right: 168px;
                z-index:999"
              @click="add"
              v-if="subdata.status!=1000"
            >添加</el-button>
          </div>

          <div v-for="(i,j) in ziliaoarr" :key="j" class="activebox" style="padding-left:10px">
            <span>活动材料{{j+1}}:</span>
            <!-- <el-input
              v-model="name[j]"
              name="activity"
              style="width:750px;"
              required
              class="midsion"
            ></el-input> -->
               <el-input
              v-model="name[j]"
              name="activity"
              style="width:750px;"
              required
              class="midsion"
            ></el-input>
            <!-- <input type="text" name="activity" value v-model="name[j]" required class="midsion" /> -->
            <el-button
              type="danger"
              icon="el-icon-delete"
              circle
              style="margin-left:64px"
              @click="delactive(j)"
              v-if="subdata.status!=1000"
            ></el-button>
            <div @click="active1(j)">
              <el-upload
                class="avatar-uploader activeup"
                :action="$upload"
                :show-file-list="false"
                style="position: relative"
                :http-request="uploadfile6"
                :disabled="subdata.status == 1000"
                accept=".pdf"
              >
                <div style="position: absolute;z-index:9999;width:80px;left:12px;top:42px">
                  <!-- {{uploadname[2]}} -->
                  <!--   -->
                  <el-progress
                    v-if="uploadname[j+7] && uploadname[j+7] != 100"
                    :text-inside="true"
                    :stroke-width="16"
                    :percentage="uploadname[j+7]"
                    status="success"
                  ></el-progress>
                </div>
                <!-- {{i}} -->
                <img v-if="i!=1&&i" :src="i" class="avatar" style="margin-left:0px" />
                <i v-else class="el-icon-plus avatar-uploader-icon" style="margin-left:0px"></i>
              </el-upload>
              <a class="filename" :href="urls[j]" v-if="i!=1&&i">{{filenamearr[j]}}</a>
              <!-- <a class="filename" :href="urls[j]" v-if="i!=1&&i">{{filenamearr[j]}}</a> -->
              <p class="tip">点击上方图标可上传文件</p>
              <p class="tip">活动材料单个压缩包不能超过150MB</p>
              <div @click="beforeRemove1('','imageUrl3',j)" v-if="i.length&&subdata.status!=1000">
                <i class="el-icon-close close" style="left:100px;top:-200px"></i>
              </div>
              <!--文件上传-->
            </div>
          </div>
        </div>
        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>六、上传政购项目专项资金收支情况表
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile3"
            :disabled="subdata.status == 1000"
            accept=".pdf"
          >
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <!-- {{uploadname[2]}} -->
              <!--   -->
              <el-progress
                v-if="uploadname[3] && uploadname[3] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[3]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl4" :src="imageUrl4" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- {{filename4? filename4.split('_')[0]+''+(filename4.split('_')[0].includes('.')?'':'.'+filename4.split('.')[1]):""}} -->
          <a class="filename" :href="fileurl4">{{filename4?filename4:''}}</a>
          <p class="tip">点击上方图标可上传文件</p>
          <div @click="beforeRemove1(filename4,'imageUrl4')" v-if="imageUrl4&&subdata.status!=1000">
            <i class="el-icon-close close"></i>
          </div>
          <!--文件上传-->
        </div>
        <div class="mid_box">
          <h3>
            <span style="color:red;margin-right:10px">*</span>七、其他类(请依据项目书内容产出进行交付，例如：实物产出物、调研报告等)
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile4"
            :disabled="subdata.status == 1000"
            accept=".pdf"
          >
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <!-- {{uploadname[2]}} -->
              <!--   -->
              <el-progress
                v-if="uploadname[4] && uploadname[4] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[4]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl5" :src="imageUrl5" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- {{filename5? filename5.split('_')[0]+''+(filename5.split('_')[0].includes('.')?'':'.'+filename5.split('.')[1]):""}} -->
          <a class="filename" :href="fileurl5">{{filename5?filename5:'' }}</a>
          <p class="tip">点击上方图标可上传文件</p>
          <div @click="beforeRemove1(filename5,'imageUrl5')" v-if="imageUrl5&&subdata.status!=1000">
            <i class="el-icon-close close"></i>
          </div>
          <!--文件上传-->
        </div>
        <div class="mid_box">
          <h3>
            <!-- <span style="color:red;margin-right:10px">*</span> -->
            八、中期PPT文件上传
          </h3>

          <el-upload
            class="avatar-uploader"
            :action="$upload"
            :show-file-list="false"
            style="position: relative"
            :http-request="uploadfile5"
           :disabled="subdata.status == 1000"
          >

           <!--  -->
            <div style="position: absolute;z-index:9999;width:80px;left:14px;top:42px">
              <!-- {{uploadname[2]}} -->
              <!--   -->
              <el-progress
                v-if="uploadname[5] && uploadname[5] != 100"
                :text-inside="true"
                :stroke-width="16"
                :percentage="uploadname[5]"
                status="success"
              ></el-progress>
            </div>
            <img v-if="imageUrl6" :src="imageUrl6" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- {{filename6? filename6.split('_')[0]+''+(filename6.split('_')[0].includes('.')?'':'.'+filename6.split('.')[1]):""}} -->
          <a class="filename" :href="fileurl6">{{filename6? filename6:""}}</a>
          <p class="tip">点击上方图标可上传文件</p>
          <div @click="beforeRemove1(filename6,'imageUrl6')" v-if="imageUrl6&&subdata.status!=1000">
            <i class="el-icon-close close"></i>
          </div>
          <!--   -->
          <!--文件上传-->
        </div>
        <!-- <div class="ll">
                <button type="button" @click="submit(0)">保存</button>
                <button type="submit" @click="submit(1)">提交</button>
        </div>-->
        <div class="ll">
          <el-form
            v-model="numberValidateForm"
            ref="numberValidateForm"
            label-width="100px"
            class="demo-ruleForm"
          >
          <!--  -->
            <el-form-item v-if="subdata.status!=1000">
              <button type="button" @click="before">返回</button>
              <button type="button" @click="postApply(0)">保存</button>
              <button type="button" @click="postApply(1)" class="tj">提交</button>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </div>
    <footer-nav class="footer"></footer-nav>
  </div>
</template>
<script>
const path = require("path");
const files = require.context("@/components", false, /\.vue$/);
const modules = {};
files.keys().forEach(key => {
  const names = path.basename(key, ".vue");
  modules[names] = files(key).default || files(key);
});

export default {
  components: modules,
  props: {},
  data() {
    return {
      index_num: 2,
      sub: 0,
      informText: "",
      informVal: "",
      projectsText: "",
      projectsVal: "",
      golasText: "",
      golasVal: "",
      comtabText: "",
      comtabVal: "",
      effectText: "",
      effectVal: "",
      resonaText: "",
      resonaVal: "",
      releaseText: "",
      releaseVal: "",
      plementText: "",
      plementVal: "",
      imageUrl: "",
      company: "",
      share: "",
      activity: "",
      numberValidateForm: "",
      uploadForm: new FormData(),
      getsubs: null,
      subStatus: 0,
      project_id: 83,
      people: "",
      develop: "",
      pro_condition: "",
      result: "",
      summary: "",
      fina: "",
      elereport: "",
      adjust: "",
      ziliao: "",
      budget: "",
      other: "",
      PPT: "",
      org_name: "",
      goalsVal: "",
      visitDate: [],
      team: "",
      teamval: "",
      infomrText: "",
      imageUrl: "",
      imageUrl1: "",
      imageUrl2: "",
      imageUrl3: [],
      imageUrl4: "",
      imageUrl5: "",
      imageUrl6: "",
      fileurl: "",
      fileurl1: "",
      fileurl2: "",
      fileurl3: [{ name: "", elereport: "" }],
      fileurl4: "",
      fileurl5: "",
      fileurl6: "",
      filename: "",
      filename1: "",
      filename2: "",
      filename3: "",
      filename4: "",
      filename5: "",
      filename6: "",
      shili: "",
      shili1: "",
      ziliaoarr: [1],
      name: [],
      urls: [],
      teamtext: "aaa",
      urlno: 0,
      chooseurl: [],
      urlorder: [],
      filetype: [],
      picarr: [],
      filenamearr: [],
      uploadname: ["", "", "", "", "", "", ""],
      uploadno: "",
      uploadfun: "",
      goalsText:"",
      team5:"",
      subdata:{},
      dialogVisible:false
    };
  },
  computed: {},
  watch: {
    ziliaoarr() {
      for (let i in this.ziliaoarr) {
        // this.urls[i] = "";
        // this.imageUrl3[i]=""
        // this.filetype[i]=""
      }
    },
    imageUrl3() {},
    filetype() {
      // for(let i in this.filetype){
      //   console.log(this.filetype[i],"7946")
      //   if(this.filetype[i]=="docx"){
      //     this.imageUrl3[i]="/static/img/word.png"
      //   }else if(this.filetype[i]="pptx"){
      //     this.imageUrl3[i]="/static/img/ppt.png"
      //   }else if(this.filetype[i]=="pdf"){
      //      this.imageUrl3[i]="/static/img/pdf.jpg"
      //   }else if(this.filetype[i]="xls"){
      //     this.imageUrl3[i]="/static/img/excel.png"
      //   }
      // }
      //             for (let i in this.ziliaoarr) {
      //   for (let m in this.filetype) {
      //     if (m == i) {
      //       //    if (file.response.data.extension == "docx") {
      //       //    this.$set(this.ziliaoarr, i, "/static/img/word.png");
      //       // } else if (file.response.data.extension == "pptx") {
      //       //    this.$set(this.ziliaoarr, i,  "/static/img/ppt.png");
      //       // } else if (file.response.data.extension == "pdf") {
      //       //   // this.imageUrl3[x] = "/static/img/pdf.jpg";
      //       //   this.$set(this.ziliaoarr, i,  "/static/img/pdf.jpg");
      //       // } else if (file.response.data.extension == "xls") {
      //       //   // this.imageUrl3[x] = "/static/img/excel.png";
      //       //     this.$set(this.ziliaoarr, i,  "/static/img/excel.png");
      //       // }
      //       this.$set(this.ziliaoarr, i, this.imageUrl3[m]);
      //       // this.ziliaoarr[i]=this.imageUrl3[m]
      //     }
      //   }
      // }
    }
  },
  methods: {
    teamchange(e){
      console.log(e,111)
      this.team=e
    },
    fazhan(e){
      this.infomrText=e
      console.log(e)
    },
    uploadfile(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            2,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
          console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[2] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess2(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    //  四  批复意见

    uploadfile1(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            1,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
          console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[1] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess1(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    // 中期电子报告

    uploadfile2(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            0,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
          // console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[0] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    // 项目财务报告

    uploadfile3(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            3,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
          // console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[3] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess4(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    // 财务报告

    uploadfile4(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            4,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
          // console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[4] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess5(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    // 其他类

    uploadfile5(f) {
     // console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小
         // console.log(progressEvent.loaded)
          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            5,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          // console.log(this.uploadname, "asd");
          if(progressEvent.loaded >307200000){
           this.dialogVisible = true;
            return false;
          }
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[5] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess6(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },
    // ppt

    uploadfile6(f) {
      console.log(f);
      let formdata = new FormData();
      formdata.append("file", f.file);
      this.$axios({
        url: "v1/file/files",
        method: "post",
        data: formdata,
        nol: 45,
        headers: { "Content-Type": "multipart/form-data" },
        onUploadProgress: progressEvent => {
          // progressEvent.loaded:已上传文件大小
          // progressEvent.total:被上传文件的总大小

          // this.uploadname =  parseInt(progressEvent.loaded / progressEvent.total * 100)
          // console.log(this.uploadno,"mmmmmm")

          this.$set(
            this.uploadname,
            this.urlno+7,
            parseInt((progressEvent.loaded / progressEvent.total) * 100)
          );
          if(progressEvent.loaded >153550000){
            this.$message.error("上传文件过大，请重新上传!");
            return false;
          }
          // console.log(this.uploadname, "asd");
        }
      })
        .then(res => {
          // this.imageUrl = res.data.data
          if (this.uploadname[this.urlno+7] === 100) {
            // this.progressPercent = 0
            this.handleAvatarSuccess3(res.data.data, f.file.name);
            // this.uploadfun.fun(res.data.data, f.file.name);
          }
        })
        .then(error => {
          console.log(error);
        });
      return;
    },

    delactive(e) {
      console.log(e);
      this.ziliaoarr.splice(e, 1);
      this.name.splice(e, 1);
      console.log(this.ziliaoarr, 200);
    },
    before() {
      this.$jParams("schedule", { id: this.id, mid_sub: 1 });
      //    this.$router.push({  //核心语句
      //   path:'/schedule',   //跳转的路径
      //   params:{           //路由传参时push和query搭配使用 ，作用时传递参数
      //     id:this.id ,
      //   }
      // })
    },
    beforeRemove1(e, f, g) {
      console.log(e);
      console.log(f, "remove");
      if (e.length) {
        this.$confirm(`删除文件后将无法恢复，请谨慎操作 ?`).then(() => {
          // this.handleRemove1()
          switch (f) {
            case "imageUrl":
              this.imageUrl = "";
              this.filename = "";
              this.fileurl=""
              break;
            case "imageUrl1":
              this.imageUrl1 = "";
              this.filename1 = "";
              this.fileurl1=""
              break;
            case "imageUrl2":
              this.imageUrl2 = "";
              this.filename2 = "";
              this.fileurl2=""
              break;
            case "imageUrl3":
              this.imageUrl3 = "";
              this.filename3 = "";
              this.fileurl3=""
              break;
            case "imageUrl4":
              this.imageUrl4 = "";
              this.filename4 = "";
              this.fileurl4=""
              break;
            case "imageUrl5":
              this.imageUrl5 = "";
              this.filename5 = "";
              this.fileurl5=""
              break;
            case "imageUrl6":
              this.imageUrl6 = "";
              this.filename6 = "";
              this.fileurl6=""
              break;
            case "imageUrl7":
              this.imageUrl7 = "";
              this.filename7 = "";
              this.fileurl7=""
              break;
            case "imageUrl8":
              this.imageUrl8 = "";
              this.filename8 = "";
              this.fileurl8=""
              break;
            case "imageUrl9":
              this.imageUrl9 = "";
              this.filename9 = "";
              this.fileurl9=""
              break;
            case "imageUrl10":
              this.imageUrl10 = "";
              this.filename10 = "";
              this.fileurl10=""
              break;
            default:
              break;
          }
          console.log("zzz");
        });
      } else {
        this.$confirm(`删除文件后将无法恢复，请谨慎操作`).then(() => {
          // this.handleRemove1()
          switch (f) {
            case "imageUrl3":
              console.log(g, "kkk");
              this.imageUrl3[g] = "";
              this.ziliaoarr[g] = "";
              this.filetype[g] = "";
              for (let i in this.filetype) {
                // console.log(this.filetype[i],"7946")
                if (this.filetype[i] == "docx" || this.filetype[i] == "doc") {
                  this.imageUrl3[i] = "/static/img/word.png";
                } else if (
                  this.filetype[i] == "pptx" ||
                  this.filetype[i] == "ppt"
                ) {
                  this.imageUrl3[i] = "/static/img/ppt.png";
                } else if (this.filetype[i] == "pdf") {
                  this.imageUrl3[i] = "/static/img/pdf.jpg";
                } else if (
                  this.filetype[i] == "xls" ||
                  this.filetype[i] == "xlsx"
                ) {
                  this.imageUrl3[i] = "/static/img/excel.png";
                } else if (
                  this.filetype[i] == "jpg" ||
                  this.filetype[i] == "jpeg" ||
                  this.filetype[i] == "png"
                ) {
                  this.imageUrl3[this.urlno] = file.response.data.url;
                  // this.imageUrl7[i] = file.response.data.url;
                }
              }

              for (let i in this.ziliaoarr) {
                for (let m in this.imageUrl3) {
                  if (m == i) {
                    this.$set(this.ziliaoarr, i, this.imageUrl3[m]);
                    // this.ziliaoarr[i]=this.imageUrl3[m]
                  }
                }
              }
              break;
            default:
              break;
          }
          console.log("mmmm");
        });
      }

      return;
    },
    add() {
      console.log(111)
      this.ziliaoarr.push(1);
      this.name.push("");
      this.uploadname.push("");
    },
    active1(m) {
      // console.log(m)
      this.chooseurl.push(m);
      this.urlno = m;
      //  this.chooseurl[this.urlorder]=m
    },
    getTime() {},
    team1(data) {
      console.log(data, "data");
      this.teamtext = data;
    },
    // inform(data) {
    //   console.log(data,44444);
    //   this.infomrText = data;
    // },
    inform2(data) {
      console.log(data, "111111e");
      this.team = data;
    },
    projects(data) {
      this.projectsText = data;
    },
    goals(data) {
      this.goalsText = data;
    },
    comtab(data) {
      this.comtabText = data;
    },
    effect(data) {
      this.effectText = data;
    },
    resona(data) {
      this.resonaText = data;
    },
    release(data) {
      this.releaseText = data;
    },
    plement(data) {
      this.plementText = data;
    },
    fileloading(e,f,g,m){
      let houzui = e.substring(e.lastIndexOf(".")+1)//e.split('.')[3]
      console.log(houzui)
         if (houzui == "doc" || houzui == "docx") {
        this[g] = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this[g] = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this[g] = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this[g] = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this[g] =e
      }else if (houzui == "zip" || houzui == "rar") {
        this[g] = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this[g] = "/static/img/txt.jpg";
      }
      this[f]=e.split('/')[8]
      this[m]=e
      console.log(e.split('/'))
    },


    handleAvatarSuccess(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl = res.url;

      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl = "/static/img/txt.jpg";
      }
      this.filename = res.names+'.'+res.extension;
      // this.fileurl = file.response.data.url;
      // // this.imageUrl =  file.ressponse.data.url;
      // this.filename = file.response.data.name;
      // if (
      //   file.response.data.extension == "docx" ||
      //   file.response.data.extension == "doc"
      // ) {
      //   this.imageUrl = "/static/img/word.png";
      // } else if (
      //   file.response.data.extension == "pptx" ||
      //   file.response.data.extension == "ppt"
      // ) {
      //   this.imageUrl = "/static/img/ppt.png";
      // } else if (file.response.data.extension == "pdf") {
      //   this.imageUrl = "/static/img/pdf.jpg";
      // } else if (
      //   file.response.data.extension == "xls" ||
      //   file.response.data.extension == "xlsx"
      // ) {
      //   this.imageUrl = "/static/img/excel.png";
      // } else if (
      //   file.response.data.extension == "jpg" ||
      //   file.response.data.extension == "jpeg" ||
      //   file.response.data.extension == "png"
      // ) {
      //   this.imageUrl = file.response.data.url;
      // }
    },
    handleAvatarSuccess1(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl1 = res.url;

      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl1 = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl1 = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl1 = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl1 = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl1 = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl1 = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl1 = "/static/img/txt.jpg";
      }
      this.filename1 = res.names+'.'+res.extension;
      // this.fileurl1 = file.response.data.url;
      // this.imageUrl1 = file.response.data.url;
      // if (
      //   file.response.data.extension == "doc" ||
      //   file.response.data.extension == "docx"
      // ) {
      //   this.imageUrl1 = "/static/img/word.png";
      // } else if (
      //   file.response.data.extension == "pptx" ||
      //   file.response.data.extension == "ppt"
      // ) {
      //   this.imageUrl1 = "/static/img/ppt.png";
      // } else if (file.response.data.extension == "pdf") {
      //   this.imageUrl1 = "/static/img/pdf.jpg";
      // } else if (
      //   file.response.data.extension == "xls" ||
      //   file.response.data.extension == "xlsx"
      // ) {
      //   this.imageUrl1 = "/static/img/excel.png";
      // } else if (
      //   file.response.data.extension == "jpg" ||
      //   file.response.data.extension == "jpeg" ||
      //   file.response.data.extension == "png"
      // ) {
      //   this.imageUrl1 = file.response.data.url;
      // }
      // this.filename1 = file.response.data.name;
      // this.imageUrl = URL.createObjectURL(file.raw);
    },
    handleAvatarSuccess2(res, file) {
      // this.imageUrl = URL.createObjectURL(file.raw);
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl2 = res.url;
      // this.imageUrl2 = file.response.data.url;
      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl2 = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl2 = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl2 = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl2 = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl2 = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl2 = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl2 = "/static/img/txt.jpg";
      }
      this.filename2 = res.names+'.'+res.extension;
    },

    handleAvatarSuccess3(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file,797464163);
      // this.fileurl = res.url;
      this.chooseurl = Array.from(new Set(this.chooseurl));
      this.filetype[this.urlno] = houzui;
        this.urls[this.urlno] = res.url
      // if (houzui == "doc" || houzui == "docx") {
      //   this.imageUrl = "/static/img/word.png";
      // } else if (houzui == "pptx" || houzui == "ppt") {
      //   this.imageUrl = "/static/img/ppt.png";
      // } else if (houzui == "pdf") {
      //   this.imageUrl = "/static/img/pdf.jpg";
      // } else if (houzui == "xls" || houzui == "xlsx") {
      //   this.imageUrl = "/static/img/excel.png";
      // } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
      //   this.imageUrl = res.url;
      // }
      // this.filename = res.name;
      this.filenamearr[this.urlno] = res.names+'.'+res.extension;
         for (let i in this.filetype) {
        // console.log(this.filetype[i],"7946")
        if (this.filetype[i] == "docx" || this.filetype[i] == "doc") {
          this.imageUrl3[i] = "/static/img/word.png";
        } else if (this.filetype[i] == "pptx" || this.filetype[i] == "ppt") {
          this.imageUrl3[i] = "/static/img/ppt.png";
        } else if (this.filetype[i] == "pdf") {
          this.imageUrl3[i] = "/static/img/pdf.jpg";
        } else if (this.filetype[i] == "xls" || this.filetype[i] == "xlsx") {
          this.imageUrl3[i] = "/static/img/excel.png";
        }else if(this.filetype[i] == "zip" || this.filetype[i] == "rar"){
          this.imageUrl3[i] = "/static/img/zip.png";
      }else if(this.filetype[i] == "txt"){
         this.imageUrl3[i] = "/static/img/txt.jpg";
      }

      else if (
          this.filetype[i] == "jpg" ||
          this.filetype[i] == "jpeg" ||
          this.filetype[i] == "png"
        ) {
          this.imageUrl3[this.urlno] =res.url
          // this.imageUrl3=this.urls
        }
      }

        for (let i in this.ziliaoarr) {
        for (let m in this.imageUrl3) {
          if (m == i) {
            this.$set(this.ziliaoarr, i, this.imageUrl3[m]);
            // this.ziliaoarr[i]=this.imageUrl3[m]
          }
        }
      }
      console.log(this.imageUrl3, "imgurl3");
      console.log(this.filetype, "filetype");
      console.log(this.filenamearr,"filenames")
    },
    handleAvatarSuccess4(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl4 = res.url;
      // this.imageUrl2 = file.response.data.url;
      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl4 = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl4 = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl4 = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl4 = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl4 = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl4 = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl4 = "/static/img/txt.jpg";
      }
      this.filename4 = res.names+'.'+res.extension;
    },
    handleAvatarSuccess5(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl5 = res.url;
      // this.imageUrl2 = file.response.data.url;
      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl5 = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl5 = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl5 = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl5 = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl5 = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl5 = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl5 = "/static/img/txt.jpg";
      }
      this.filename5 = res.names+'.'+res.extension;
    },
    handleAvatarSuccess6(res, file) {
      let houzui = file.split(".");
      houzui = houzui[houzui.length - 1];
      console.log(res, file);
      this.fileurl6 = res.url;
      // this.imageUrl2 = file.response.data.url;
      if (houzui == "doc" || houzui == "docx") {
        this.imageUrl6 = "/static/img/word.png";
      } else if (houzui == "pptx" || houzui == "ppt") {
        this.imageUrl6 = "/static/img/ppt.png";
      } else if (houzui == "pdf") {
        this.imageUrl6 = "/static/img/pdf.jpg";
      } else if (houzui == "xls" || houzui == "xlsx") {
        this.imageUrl6 = "/static/img/excel.png";
      } else if (houzui == "jpg" || houzui == "jpeg" || houzui == "png") {
        this.imageUrl6 = res.url;
      }else if(houzui == "zip" || houzui == "rar"){
         this.imageUrl6 = "/static/img/zip.png";
      }else if(houzui == "txt"){
         this.imageUrl6 = "/static/img/txt.jpg";
      }
      this.filename6 = res.names+'.'+res.extension;
    },
    beforeAvatarUpload(file, n) {
      //  console.log(this.uploadno,this.upload)
      console.log(file, n, "jindutiao");
      this.uploadno = n;
      this.uploadfun = file;

      // this.uploadfun.fun = file;
      return false;
      // console.log(this.uploadno)
      // return
      // const isJPG = file.type === "image/jpeg";
      // const isLt2M = file.size / 1024 / 1024 < 2;
      // if (!isJPG) {
      //   this.$message.error("上传头像图片只能是 JPG 格式!");
      // }
      // if (!isLt2M) {
      //   this.$message.error("上传头像图片大小不能超过 2MB!");
      // }
      // return isJPG && isLt2M;
    },
    beforeAvatarUpload1(file, n) {
      console.log(n, "up1");
      this.uploadno = n;
      this.uploadfun.fun = file;
      // console.log(this.uploadno)
      // return
      // const isJPG = file.type === "image/jpeg";
      // const isLt2M = file.size / 1024 / 1024 < 2;
      // if (!isJPG) {
      //   this.$message.error("上传头像图片只能是 JPG 格式!");
      // }
      // if (!isLt2M) {
      //   this.$message.error("上传头像图片大小不能超过 2MB!");
      // }
      // return isJPG && isLt2M;
    },
    buttonForm(formName) {
      // this.$refs[formName].validate((valid) => {
      //   if (valid) {
      //     alert('submit!');
      //   } else {
      //     console.log('error submit!!');
      //     return false;
      //   }
      // });
      alert("保存成功");
    },
    getSubmis() {
      let t = this;
      //console.log(t.$route.query.id, "aa");
      this.$http({
        method: "get",
        url: "v1/test/center",
        params: {
          id: this.$route.query.id
        }
      })
        .then(res => {
          // console.log(res.data.code)
         // console.log(res, 888);
          if (res.data.data.code === 200) {

            t.subdata=res.data.data.data.center?res.data.data.data.center:res.data.data.data.optimize
            t.getsubs = res.data.data.data.optimize;
            var date = new Date(parseInt(this.getsubs.aterm) * 1000);
            let Y = date.getFullYear().toString() + "-";
            let M =
              (date.getMonth() + 1 < 10
                ? "0" + (date.getMonth() + 1)
                : date.getMonth() + 1) + "-";
            let D = date.getDate() + " ";
           // console.log(Y + M + D);
           // console.log(this.getsubs);
            this.visitDate[0] = Y + M + D;

            var date1 = new Date(parseInt(this.getsubs.fterm) * 1000);
            let Y1 = date1.getFullYear().toString() + "-";
            let M1 =
              (date1.getMonth() + 1 < 10
                ? "0" + (date1.getMonth() + 1)
                : date1.getMonth() + 1) + "-";
            let D1 = date1.getDate() + " ";
           // console.log(Y1 + M1 + D1);
           // console.log(this.getsubs);
            this.visitDate[1] = Y1 + M1 + D1;

            let shili = res.data.data.data.optimize.probook;
            console.log(shili)

            // var filename = shili.substring(shili.lastIndexOf('/')+1);
            // console.log(filename)
            this.shili = shili.substring(shili.lastIndexOf("/") + 1);

           // console.log(this.shili,'1223')
            let shili1 = res.data.data.data.optimize.fangan;
            this.shili1 = shili1.substring(shili.lastIndexOf("/") + 1);
            // console.log(this.team,121222)s
            this.team=res.data.data.data.center.people
            this.infomrText=res.data.data.data.center.develop
            this.goalsText=res.data.data.data.center.pro_condition
            //console.log(this.goalsText,"goad")
            this.effectText=res.data.data.data.center.result
            this.plementText=res.data.data.data.center.summary
            this.fileurl=res.data.data.data.center.fina
            this.fileloading(this.fileurl,'filename','imageUrl','fileurl')
            this.fileloading(res.data.data.data.center.elereport,'filename1','imageUrl1','fileurl1')
            this.fileloading(res.data.data.data.center.adjust,'filename2','imageUrl2','fileurl2')
            let arrlist = JSON.parse(res.data.data.data.center.ziliao)
           //  console.log(arrlist.length)
             if (arrlist.length) {

               this.ziliaoarr=[]
               for(let i in arrlist){
                  let url = arrlist[i].elereport;
                    this.name[i] = arrlist[i].name;
                    this.urls[i] = arrlist[i].elereport;
                    // this.$set(this.name,i,arrlist[i].name)
                    let filename = url.split("/")[8];
                    this.$set(this.filenamearr, i, filename);
                    this.ziliaoarr.push(1)
                    let houzhui=this.filenamearr[i].substring(filename.lastIndexOf(".")+1)
                   // console.log(houzhui,'10810')
                    if(houzhui=='rar'||houzhui=='zip'){
                       this.ziliaoarr[i] = "/static/img/zip.png";
                    }else if(houzhui=='doc'||houzhui=='docx'){
                       this.ziliaoarr[i] = "/static/img/word.png";
                    }else if(houzhui=='xls'||houzhui=='xlsx'){
                       this.ziliaoarr[i] = "/static/img/excel.png";
                    }else if(houzhui=='ppt'||houzhui=='pptx'){
                       this.ziliaoarr[i] = "/static/img/ppt.png";
                    }else if(houzhui=='pdf'){
                       this.ziliaoarr[i] = "/static/img/pdf.jpg";
                    }else if(houzhui=='txt'){
                       this.ziliaoarr[i] = "/static/img/txt.jpg";
                    }else if( houzhui == "jpg" ||
                    houzhui == "jpeg" ||
                    houzhui == "png"){
                      this.ziliaoarr[i] = url;
                    }

                    // console.log(this.filenamearr)
               }

             }

              this.fileloading(res.data.data.data.center.budget,'filename4','imageUrl4','fileurl4')
                this.fileloading(res.data.data.data.center.other,'filename5','imageUrl5','fileurl5')
                 this.fileloading(res.data.data.data.center.PPT,'filename6','imageUrl6','fileurl6')
          } else {
            alert(res.data.data.message);
            this.before();
            // this.$router.replace({path:"schedule" + this.id,params:{id:this.id,mid_sub:1}})
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    postApply(index) {
      if (index == 0) {
        this.$confirm("此操作将保存当前填写的内容, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          console.log(this.ziliaoarr,this.name[0],"1111111111111111111111")
          // return false;
          for (let i in this.ziliaoarr) {
            this.fileurl3[i] = { name: "", elereport: "" };
            if (this.name[i]=="" || this.name[i]==undefined) {
              this.$message({
                  message: '活动材料名称不能为空',
                  type: "error"
              });
              // console.log(2222222)
              return false;
            }
            if (this.name[i]) {
              this.fileurl3[i].name = this.name[i];
            }
            if (this.urls[i]) {
              this.fileurl3[i].elereport = this.urls[i];
            }
          }
         // console.log(this.fileurl3, "额");
          // if(!this.fileurl){

          //   this.$message({
          //         message: '请先上传财务报告!',
          //         type: "error"
          //   });
          //   return false;
          // }
          // else
          if(!this.fileurl1){
             this.$message({
                  message: '请先上传中期报告!',
                  type: "error"
            });
             return false;
          }
          else if(!this.fileurl4){
             this.$message({
                  message: '请先上财务中期预算表!',
                  type: "error"
            });
             return false;
          }
          else if(!this.fileurl5){
             this.$message({
                  message: '请先上传其他类报告!',
                  type: "error"
            });
             return false;
          }
          // else if(!this.fileurl6){
          //    this.$message({
          //         message: '请先上传中期ppt文件!',
          //         type: "error"
          //   });
          //    return false;
          // }
          else{
          this.$http({
            method: "post",
            url: "v1/test/cent-sub",
            data: {
              subStatus: index,
              project_id: this.id,
              org_name: this.getsubs.company,
              people: this.team,
              develop: this.infomrText,
              pro_condition: this.goalsText,
              result: this.effectText,
              summary: this.plementText,
              fina: this.fileurl,
              elereport: this.fileurl1,
              adjust: this.fileurl2,
              // ziliao: this.fileurl3,
              ziliao: JSON.stringify(this.fileurl3),
              budget: this.fileurl4,
              other: this.fileurl5,
              PPT: this.fileurl6
            }
          })
            .then(res => {
              console.log(res);
              if (res.data.data.code == 200) {
                this.$message({
                  message: res.data.data.msg,
                  type: "success"
                });
                this.$router.go(-1)
                // this.$router.push({
                //   name: "project"
                // });
              } else {
                this.$message.error(res.data.data.msg);
                // this.$router.push({path: `/schedule${this.id}`});
              }
            })
            .catch(err => {
              console.log(err);
            });
          }
        });
      } else if (index == 1) {
        this.$confirm("请确认是否提交中期评审材料，提交后不可修改！", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          for (let i in this.ziliaoarr) {
            this.fileurl3[i] = { name: "", elereport: "" };
            if (this.name[i]=="" || this.name[i]==undefined) {
              this.$message({
                  message: '活动材料名称不能为空',
                  type: "error"
              });
              // console.log(2222222)
              return false;
            }
            if (this.name[i]) {
              this.fileurl3[i].name = this.name[i];
            }
            if (this.urls[i]) {
              this.fileurl3[i].elereport = this.urls[i];
            }
          }
          // if(!this.fileurl){

          //   this.$message({
          //         message: '请先上传财务报告!',
          //         type: "error"
          //   });
          //   return false;
          // }else
          if(!this.fileurl1){
             this.$message({
                  message: '请先上传中期报告!',
                  type: "error"
            });
             return false;
          }
          else if(!this.fileurl4){
             this.$message({
                  message: '请先上财务中期预算表!',
                  type: "error"
            });
             return false;
          }
          else if(!this.fileurl5){
             this.$message({
                  message: '请先上传其他类报告!',
                  type: "error"
            });
             return false;
          }
          // else if(!this.fileurl6){
          //    this.$message({
          //         message: '请先上传中期ppt文件!',
          //         type: "error"
          //   });
          //    return false;
          // }
          else{
            this.$http({
            method: "post",
            url: "v1/test/cent-sub",
            data: {
              subStatus: index,
              project_id: this.id,
              org_name: this.getsubs.company,
              people: this.team,
              develop: this.infomrText,
              pro_condition: this.goalsText,
              result: this.effectText,
              summary: this.plementText,
              fina: this.fileurl,
              elereport: this.fileurl1,
              adjust: this.fileurl2,
              // ziliao: this.fileurl3,
              ziliao: JSON.stringify(this.fileurl3),
              budget: this.fileurl4,
              other: this.fileurl5,
              PPT: this.fileurl6
            }
          })
            .then(res => {
              console.log(res);
              if (res.data.data.code == 200) {
                this.$message({
                  message: res.data.data.msg,
                  type: "success"
                });
                this.$router.go(-1)

                // this.$router.push({
                //   name: "project"
                // });
              } else {
                this.$message.error(res.data.data.msg);
                // this.$router.push({path: `/schedule${this.id}`});
              }
            })
            .catch(err => {
              console.log(err);
            });
          }
        });
      }
    }
  },
  created() {
    console.log(this.$route.query, "bba");
    this.id = this.$route.query.id;
    this.getSubmis();
    // this.postApply()
  }
};
</script>
<style lang="scss" scoped>

.tip {
  color: gray !important;
  font-size: 12px !important;
  text-indent: -3px !important;
  margin-top: 10px !important;
}
.close {
  position: relative;
  top: -168px;
  z-index: 999;
  left: 110px;
}
.tj {
  background-image: linear-gradient(
      69deg,
      #cc263f 0%,
      #f42b47 100%,
      #ed162d 100%,
      #e60012 100%
    ),
    linear-gradient(#e60012, #e60012);
}
.writeinfo {
  margin-bottom: 20px;
}
.shuru {
  margin-left: 25px;
}
.activebox {
  margin-bottom: 30px;
  margin-left: -11px;
}
// .activeup {
//   // margin-left: 45px;
// }
.rich {
  // z-index: 10;
  width: 100%;
  // margin: 30px auto 0px;
  margin-bottom: 30px;
  margin-top: 10px;
  height: 320px;
}
#excute_box {
  width: 1300px;
  margin: 0 auto;
  margin-top: 40px;
  background: white;
  .excute_con {
    width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
    margin-bottom: 51px;
    h3 {
      line-height: 260%;
      font-size: 20px;
      position: relative;
      right:19px;
    }
    p a {
      line-height: 10%;
      color: #7471ef;
      font-size: 14px;
      margin-right: 10px;
    }
    label {
      margin-left: 16px;
      font-family: "MicrosoftYaHei";
      font-size: 14px;
      font-weight: normal;
      font-stretch: normal;
      line-height: 25px;
      letter-spacing: 0px;
      color: #333333;
      // text-align: right;
      display: inline-block;
      // width: 200px;
    }
    input {
      box-sizing: border-box;
      width: 33.8%;
      height: 35px;
      background-color: #ffffff;
      border: solid 1px #c7c7c7;
      outline: none;
      margin-left: 35px;
      margin-bottom: 15px;
      font-family: "MicrosoftYaHei";
      font-size: 18px;
      font-weight: normal;
      font-stretch: normal;
      letter-spacing: 0px;
      color: #323232;
      margin-right: 35px;
    }
    .division {
      width: 76%;
    }
    .midsion {
      width: 80%;
      margin-left: 3px;
      margin-bottom: 10px;
    }
    span {
      font-size: 18px;
    }
    span a {
      color: #7471ef;
    }
    p {
      font-size: 17px;
      color: #666;
      line-height: 30px;
    }
    .download {
      color: #7471ef;
      padding-left: 30px;
      font-size: 14px;
    }
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 100px;
    height: 100px;
    line-height: 100px;
    text-align: center;
    border: 1.5px dashed #666;
    margin-left: 3px;
  }
  .avatar {
    width: 100px;
    height: 100px;
    display: block;
    // margin-left: 15px;
  }
  .mid_box span {
    font-size: 14px;
  }
  .ll {
    margin-top: 80px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    button[type="button"] {
      margin-right: 152px;
      width: 197px;
      height: 63px;
      background-color: #ff9800;
      border-radius: 5px;
      font-family: "MicrosoftYaHei";
      font-size: 26px;
      font-weight: normal;
      font-stretch: normal;
      line-height: 63px;
      letter-spacing: 0px;
      color: #ffffff;
      text-align: center;
      outline: none;
      border: 0;
      cursor: pointer;
    }

    button[type="submit"] {
      width: 197px;
      height: 63px;
      background-color: #e60012;
      border-radius: 5px;
      font-family: "MicrosoftYaHei";
      font-size: 26px;
      font-weight: normal;
      font-stretch: normal;
      line-height: 63px;
      text-align: center;
      letter-spacing: 0px;
      color: #ffffff;
      outline: none;
      border: 0;
    }
  }
}
</style>
<style >
.el-message-box__wrapper{
  z-index: 990221!important;
}
</style>
